<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath(); String basePath =
request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>

	<head>
		<base href="<%=basePath%>">
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">

		<title>订单管理</title>

		<link href="css/admin.css" rel="stylesheet" type="text/css">
		<link href="css/amazeui.css" rel="stylesheet" type="text/css">

		<link href="css/personals.css" rel="stylesheet" type="text/css">
		<link href="css/orstyle.css" rel="stylesheet" type="text/css">

		<script src="js/jquery.min.js"></script>
		<script src="js/amazeui.js"></script>
		<script src="admin/assets/layer/layer.js" type="text/javascript"></script>
	<style>
		.my_model{
	    position: fixed;
	    display: none;
	    top:50%;
	    left: 50%;
	    text-align:center;
	   	margin-top: -50px;
	    margin-left: -200px;
	    z-index: 9999;
	    width: 360px;
	    height: 25%;
	    border: 1px solid #aeaeae;
	    border-radius: 3px;
	    padding: 20px;
	    background: #fff;
	}
	.my_model .title{
	    font-size: 14px;
	    color: #3c3c3c;
	    font-weight: 700;
	    margin-bottom: 20px;
	}
	.my_model .title .closeModel{
	    float: right;
	    cursor: pointer;
	}
	.my_model p{
	    line-height:16px;
	}
	.my_model .opBtn{
	    margin-top: 20px;
	}
	.my_model .opBtn a{
	    width: 58px;
	    height: 28px;
	    line-height: 28px;
	    text-align: center;
	    -webkit-border-radius: 1px;
	    -moz-border-radius: 1px;
	    -ms-border-radius: 1px;
	    border-radius: 1px;
	    display: inline-block;
	    margin-right: 10px;
	    font-weight: 700;
	}
	.my_model .dialog-sure{
	    background: #52a0e5;
	    color: #fff;
	    border: 1px solid #52a0e5;
	}
	
	.my_model .dialog-close{
	    background: #fff;
	    border: 1px solid #d9d9d9;
	    color: #3c3c3c;
	}
	</style>
	</head>

	<body>
		<!--头 -->
			<jsp:include page="common/header.jsp"/>
		<b class="line"></b>
		<div class="center">
			<div class="col-main">
				<jsp:include page="common/user_left.jsp"></jsp:include>
				<div class="main-wrap">
					<br/>
					<div class="user-order">
						<div class="am-tabs am-tabs-d2 am-margin" data-am-tabs>

							<ul class="am-avg-sm-5 am-tabs-nav am-nav am-nav-tabs">
								<li class="am-active"><a href="#tab1">所有订单</a></li>
								<li><a href="#tab2">待付款</a></li>
								<li><a href="#tab3">待发货</a></li>
								<li><a href="#tab4">待收货</a></li>
								<li><a href="#tab5">已删除订单</a></li>
							</ul>

							<div class="am-tabs-bd">
								<div class="am-tab-panel am-fade am-in am-active" id="tab1">
									<div class="order-top">
										<div class="th th-item">
											<td class="td-inner">商品</td>
										</div>
										<div class="th th-price">
											<td class="td-inner">单价</td>
										</div>
										<div class="th th-number">
											<td class="td-inner">数量</td>
										</div>
										<div class="th th-operation">
											<td class="td-inner">商品操作</td>
										</div>
										<div class="th th-amount">
											<td class="td-inner">合计</td>
										</div>
										<div class="th th-status">
											<td class="td-inner">交易状态</td>
										</div>
										<div class="th th-change">
											<td class="td-inner">交易操作</td>
										</div>
									</div>

									<div class="order-main">
										<div class="order-list">
											
											<!--全部订单-->
											<c:forEach items="${orders}" var="order">
											<c:if test="${order.isrefund!=1 }">
											<div class="order-status5">
												<div class="order-title">
													<div class="dd-num">订单编号：<a href="/orders/getOrderByInfo/${order.orderid }">${order.orderno }</a></div>
													<span>下单时间：<fmt:formatDate value="${order.createtime}" pattern="yyyy-MM-dd HH:mm:ss"/></span>
													<!--    <em>店铺：小桔灯</em>-->
												</div>
												<div class="order-content">
													<div class="order-left">
														<c:forEach items="${order.ogs }" var="og">
														<ul class="item-list">
															<li class="td td-item">
																<div class="item-pic">
																	<a href="#" class="J_MakePoint">
																		<img style="width:80px;height:80px;" src="${og.goodsthums}" class="itempic J_ItemImg">
																	</a>
																</div>
																<div class="item-info">
																	<div class="item-basic-info">
																		<a href="#">
																			<p><a href="/orders/getOrderByInfo/${og.orderid }">${og.goodsnames}</a></p>
																		</a>
																	</div>
																</div>
															</li>
															<li class="td td-price">
																<div class="item-price">
																	${og.goodsprice }
																</div>
															</li>
															<li class="td td-number">
																<div class="item-number">
																	<span>×</span>${og.goodnums }
																</div>
															</li>
															<li class="td td-operation">
																<div class="item-operation">
																	
																</div>
															</li>
														</ul>
														</c:forEach>
													</div>
													<div class="order-right">
														<li class="td td-amount">
															<div class="item-amount">
																合计：${order.goodcount}
																<p>实际付款：<span>${order.realprice }</span></p>
															</div>
														</li>
														<div class="move-right">
															<li class="td td-status">
																<div class="item-status">
																	<c:if test="${order.orderstatus!=-1 }">
																	<c:if test="${order.ispay==0}">
																		<p class="order-info">该账单暂未付款</p>
																	</c:if>
																	<c:if test="${order.issend==1 }">
																	<p class="order-info">卖家已发货</p>
																	<p class="order-info"><a href="logistics.html">查看物流</a></p>
																	<p class="order-info"><a href="#">延长收货</a></p>
																	<c:if test="${order.istakeover==1 }">
																	<p class="order-info">已收货</p>
																	</c:if>
																	</c:if>
																	<c:if test="${order.issend==0 }">
																	<p class="order-info">未发货</p>
																	</c:if>
																	</c:if>
																	<c:if test="${order.orderstatus==-1}">
																		<p class="order-info">该订单已被删除</p>
																	</c:if>
																</div>
															</li>
															<li class="td td-change">
																<c:if test="${order.orderstatus!=-1 }">
																<c:if test="${order.issend==1&&order.ispay==1&&order.istakeover!=1}">
																	<div onclick="updistake(${order.orderid});" class="am-btn am-btn-danger anniu">
																	确认收货</div>
																</c:if>
																<c:if test="${order.issend==1&&order.ispay==1&&order.istakeover==1}">
																	<div class="am-btn am-btn-danger anniu">
																	已收货</div>
																</c:if>
																<c:if test="${order.ispay==1 && order.issend==0 }">
																	<div class="am-btn am-btn-danger anniu">
																	联系客服</div>
																</c:if>
																
																<c:if test="${order.ispay==0 or order.istakeover==1}">
																	<div onclick="delOrder(${order.orderid});" style="margin:5px 0px;" class="am-btn am-btn-danger anniu">删除订单</div>
																</c:if>
																
																<%-- <input type="text" id="orderid" value="${order.orderid }" /> --%>
																<c:if test="${order.ispay==0}">
																	<div onclick="showCheck(${order.orderid},${order.realprice});" class="am-btn am-btn-danger anniu">
																	订单结算</div>
																</c:if>
																</c:if>
															</li>
														</div>
													</div>
												</div>
											</div>
											</c:if>
											</c:forEach>
											
										</div>

									</div>

								</div>
								
								<!-- 未付款订单 -->
								<div class="am-tab-panel am-fade" id="tab2">

									<div class="order-top">
										<div class="th th-item">
											<td class="td-inner">商品</td>
										</div>
										<div class="th th-price">
											<td class="td-inner">单价</td>
										</div>
										<div class="th th-number">
											<td class="td-inner">数量</td>
										</div>
										<div class="th th-operation">
											<td class="td-inner">商品操作</td>
										</div>
										<div class="th th-amount">
											<td class="td-inner">合计</td>
										</div>
										<div class="th th-status">
											<td class="td-inner">交易状态</td>
										</div>
										<div class="th th-change">
											<td class="td-inner">交易操作</td>
										</div>
									</div>

									<div class="order-main">
										<div class="order-list">
											<c:forEach items="${orders}" var="order">
											<c:if test="${order.ispay==0 && order.isrefund!=1}">
											<div class="order-status1">
												<div class="order-title">
													<div class="dd-num">订单编号：<a href="/orders/getOrderByInfo/${order.orderid }">${order.orderno }</a></div>
													<span>下单时间：<fmt:formatDate value="${order.createtime}" pattern="yyyy-MM-dd HH:mm:ss"/></span>
													<!--    <em>店铺：小桔灯</em>-->
												</div>
												<div class="order-content">
													<div class="order-left">
														<c:forEach items="${order.ogs }" var="og">
														<ul class="item-list">
															<li class="td td-item">
																<div class="item-pic">
																	<a href="#" class="J_MakePoint">
																		<img style="width:80px;height:80px;" src="${og.goodsthums}" class="itempic J_ItemImg">
																	</a>
																</div>
																<div class="item-info">
																	<div class="item-basic-info">
																		<a href="/orders/getOrderByInfo/${og.orderid }">
																			<p>${og.goodsnames}</p>
																		</a>
																	</div>
																</div>
															</li>
															<li class="td td-price">
																<div class="item-price">
																	${og.goodsprice }
																</div>
															</li>
															<li class="td td-number">
																<div class="item-number">
																	<span>×</span>${og.goodnums }
																</div>
															</li>
															<li class="td td-operation">
																<div class="item-operation">
																	
																</div>
															</li>
														</ul>
														</c:forEach>
													</div>
													<div class="order-right">
														<li class="td td-amount">
															<div class="item-amount">
																合计：${order.goodcount}
																<p>实际付款：<span>${order.realprice }</span></p>
															</div>
														</li>
														<div class="move-right">
															<li class="td td-status">
																<div class="item-status">
																	<p class="order-info">该账单暂未付款</p>
																	<c:if test="${order.orderstatus==1 }">
																		<p class="order-info">正常</p>
																	</c:if>
																	<c:if test="${order.orderstatus==-1 }">
																		<p class="order-info">订单商品已下架</p>
																	</c:if>
																	<c:if test="${order.orderstatus==2 }">
																		<p class="order-info">订单已被删除</p>
																	</c:if>
																</div>
															</li>
															<li class="td td-change">
																<c:if test="${order.orderstatus!=-1 }">
																<div onclick="delOrder(${order.orderid});" class="am-btn am-btn-danger anniu" style="margin:5px 0px;">
																	删除订单</div>
																<div onclick="showCheck(${order.orderid},${order.realprice});" class="am-btn am-btn-danger anniu">
																	订单结算</div>
																</c:if>
															</li>
														</div>
													</div>
												</div>
											</div>
											</c:if>
											</c:forEach>
										</div>
									</div>
								</div>
								<div class="am-tab-panel am-fade" id="tab3">
									<div class="order-top">
										<div class="th th-item">
											<td class="td-inner">商品</td>
										</div>
										<div class="th th-price">
											<td class="td-inner">单价</td>
										</div>
										<div class="th th-number">
											<td class="td-inner">数量</td>
										</div>
										<div class="th th-operation">
											<td class="td-inner">商品操作</td>
										</div>
										<div class="th th-amount">
											<td class="td-inner">合计</td>
										</div>
										<div class="th th-status">
											<td class="td-inner">交易状态</td>
										</div>
										<div class="th th-change">
											<td class="td-inner">交易操作</td>
										</div>
									</div>

									<div class="order-main">
										<div class="order-list">
											<c:forEach items="${orders}" var="order">
											<c:if test="${order.ispay==1 and order.issend==0 and order.isrefund!=1}">
											<div class="order-status5">
												<div class="order-title">
													<div class="dd-num">订单编号：<a href="/orders/getOrderByInfo/${order.orderid }">${order.orderno }</a></div>
													<span>
														下单时间：<fmt:formatDate value="${order.createtime}" pattern="yyyy-MM-dd HH:mm:ss"/>
													</span>
													<span style="margin-left:10px;">
														支付时间：<fmt:formatDate value="${order.paytime}" pattern="yyyy-MM-dd HH:mm:ss"/>
													</span>
													<!--    <em>店铺：小桔灯</em>-->
												</div>
												<div class="order-content">
													<div class="order-left">
														<c:forEach items="${order.ogs }" var="og">
														<ul class="item-list">
															<li class="td td-item">
																<div class="item-pic">
																	<a href="#" class="J_MakePoint">
																		<img style="width:80px;height:80px;" src="${og.goodsthums}" class="itempic J_ItemImg">
																	</a>
																</div>
																<div class="item-info">
																	<div class="item-basic-info">
																		<a href="/orders/getOrderByInfo/${og.orderid }">
																			<p>${og.goodsnames}</p>
																		</a>
																	</div>
																</div>
															</li>
															<li class="td td-price">
																<div class="item-price">
																	${og.goodsprice }
																</div>
															</li>
															<li class="td td-number">
																<div class="item-number">
																	<span>×</span>${og.goodnums }
																</div>
															</li>
															<li class="td td-operation">
																<div class="item-operation">
																	<c:if test="${order.orderstatus==-1 }">
																	<p>该订单下的商品已下架</p>
																	</c:if>
																</div>
															</li>
														</ul>
														</c:forEach>
													</div>
													<div class="order-right">
														<li class="td td-amount">
															<div class="item-amount">
																合计：${order.goodcount}
																<p>实际付款：<span>${order.realprice }</span></p>
															</div>
														</li>
														<div class="move-right">
															<li class="td td-status">
																<div class="item-status">
																	<p class="order-info">未发货</p>
																</div>
															</li>
															<li class="td td-change">
																<div class="am-btn am-btn-danger anniu">
																联系客服</div>
															</li>
														</div>
													</div>
												</div>
											</div>
											</c:if>
											</c:forEach>
										</div>
									</div>
								</div>
								<div class="am-tab-panel am-fade" id="tab4">
									<div class="order-top">
										<div class="th th-item">
											<td class="td-inner">商品</td>
										</div>
										<div class="th th-price">
											<td class="td-inner">单价</td>
										</div>
										<div class="th th-number">
											<td class="td-inner">数量</td>
										</div>
										<div class="th th-operation">
											<td class="td-inner">商品操作</td>
										</div>
										<div class="th th-amount">
											<td class="td-inner">合计</td>
										</div>
										<div class="th th-status">
											<td class="td-inner">交易状态</td>
										</div>
										<div class="th th-change">
											<td class="td-inner">交易操作</td>
										</div>
									</div>

									<div class="order-main">
										<div class="order-list">
											<c:forEach items="${orders}" var="order">
											<c:if test="${order.ispay==1 && order.issend==1 && order.istakeover==0 && order.isrefund!=1}">
											<div class="order-status3">
												<div class="order-title">
													<div class="dd-num">订单编号：<a href="/orders/getOrderByInfo/${order.orderid }">${order.orderno }</a></div>
													<span>
														下单时间：<fmt:formatDate value="${order.createtime}" pattern="yyyy-MM-dd HH:mm:ss"/>
													</span>
													<span style="margin-left:10px;">
														支付时间：<fmt:formatDate value="${order.paytime}" pattern="yyyy-MM-dd HH:mm:ss"/>
													</span>
													<span style="margin-left:10px;">
														发货时间：<fmt:formatDate value="${order.deliervytime}" pattern="yyyy-MM-dd HH:mm:ss"/>
													</span>
													<!--    <em>店铺：小桔灯</em>-->
												</div>
												<div class="order-content">
													<div class="order-left">
														<c:forEach items="${order.ogs }" var="og">
														<ul class="item-list">
															<li class="td td-item">
																<div class="item-pic">
																	<a href="#" class="J_MakePoint">
																		<img style="width:80px;height:80px;" src="${og.goodsthums}" class="itempic J_ItemImg">
																	</a>
																</div>
																<div class="item-info">
																	<div class="item-basic-info">
																		<a href="/orders/getOrderByInfo/${og.orderid }">
																			<p>${og.goodsnames}</p>
																		</a>
																	</div>
																</div>
															</li>
															<li class="td td-price">
																<div class="item-price">
																	${og.goodsprice}
																</div>
															</li>
															<li class="td td-number">
																<div class="item-number">
																	<span>×</span>${og.goodnums }
																</div>
															</li>
															<li class="td td-operation">
																<div class="item-operation">
																	
																</div>
															</li>
														</ul>
														</c:forEach>
													</div>
													<div class="order-right">
														<li class="td td-amount">
															<div class="item-amount">
																合计：${order.goodcount}
																<p>实际付款：<span id="money">${order.realprice }</span></p>
															</div>
														</li>
														<div class="move-right">
															<li class="td td-status">
																<div class="item-status">
																	<c:if test="${order.issend==1 }">
																	<p class="order-info">卖家已发货</p>
																	<p class="order-info"><a href="logistics.html">查看物流</a></p>
																	<p class="order-info"><a href="#">延长收货</a></p>
																	</c:if>
																</div>
															</li>
															<li class="td td-change">
																<c:if test="${order.issend==1&&order.ispay==1&&order.istakeover!=1}">
																	<div onclick="updistake(${order.orderid});" class="am-btn am-btn-danger anniu">
																	确认收货</div>
																</c:if>
																<c:if test="${order.orderstatus!=-1 }">
																<div style="margin:5px 0px;" class="am-btn am-btn-danger anniu">
																	删除订单</div>
																</c:if>
															</li>
														</div>
													</div>
												</div>
											</div>
											</c:if>
											</c:forEach>
										</div>
									</div>
								</div>
								<div class="am-tab-panel am-fade" id="tab5">
									<div class="order-top">
										<div class="th th-item">
											<td class="td-inner">商品</td>
										</div>
										<div class="th th-price">
											<td class="td-inner">单价</td>
										</div>
										<div class="th th-number">
											<td class="td-inner">数量</td>
										</div>
										<div class="th th-operation">
											<td class="td-inner">商品操作</td>
										</div>
										<div class="th th-amount">
											<td class="td-inner">合计</td>
										</div>
										<div class="th th-status">
											<td class="td-inner">交易状态</td>
										</div>
										<div class="th th-change">
											<td class="td-inner">交易操作</td>
										</div>
									</div>

									<div class="order-main">
										<div class="order-list">
											<c:forEach items="${orders}" var="order">
											<c:if test="${order.orderstatus==-1 && order.isrefund!=1}">
											<div class="order-status3">
												<div class="order-title">
													<div class="dd-num">订单编号：<a href="/orders/getOrderByInfo/${order.orderid }">${order.orderno }</a></div>
													<span>
														下单时间：<fmt:formatDate value="${order.createtime}" pattern="yyyy-MM-dd HH:mm:ss"/>
													</span>
													<span style="margin-left:10px;">
														支付时间：<fmt:formatDate value="${order.paytime}" pattern="yyyy-MM-dd HH:mm:ss"/>
													</span>
													<span style="margin-left:10px;">
														发货时间：<fmt:formatDate value="${order.deliervytime}" pattern="yyyy-MM-dd HH:mm:ss"/>
													</span>
													<!--    <em>店铺：小桔灯</em>-->
												</div>
												<div class="order-content">
													<div class="order-left">
														<c:forEach items="${order.ogs }" var="og">
														<ul class="item-list">
															<li class="td td-item">
																<div class="item-pic">
																	<a href="#" class="J_MakePoint">
																		<img style="width:80px;height:80px;" src="${og.goodsthums}" class="itempic J_ItemImg">
																	</a>
																</div>
																<div class="item-info">
																	<div class="item-basic-info">
																		<a href="/orders/getOrderByInfo/${og.orderid }">
																			<p>${og.goodsnames}</p>
																		</a>
																	</div>
																</div>
															</li>
															<li class="td td-price">
																<div class="item-price">
																	${og.goodsprice}
																</div>
															</li>
															<li class="td td-number">
																<div class="item-number">
																	<span>×</span>${og.goodnums }
																</div>
															</li>
															<li class="td td-operation">
																<div class="item-operation">
																	
																</div>
															</li>
														</ul>
														</c:forEach>
													</div>
													<div class="order-right">
														<li class="td td-amount">
															<div class="item-amount">
																合计：${order.goodcount}
																<p>实际付款：<span id="money">${order.realprice }</span></p>
															</div>
														</li>
														<div class="move-right">
															<li class="td td-status">
																<div class="item-status">
																	<p class="order-info">该订单已被删除</p>
																</div>
															</li>
															<li class="td td-change">
															
																<!-- <div style="margin:5px 0px;" class="am-btn am-btn-danger anniu">
																	删除订单</div> -->
															</li>
														</div>
													</div>
												</div>
											</div>
											</c:if>
											</c:forEach>
										</div>
									</div>
								</div>

							</div>

						</div>
					</div>
				</div>
				<input type="hidden" id="userid" value="${user.userid }" />
				<!-- <input type="text" id="orderid2" value="" /> -->
				<form id="frmchekrepwd">
					<section class="model_bg"></section>
				   <section class="my_model">
				       <p class="title">请输入支付密码：<span class="closeModel">X</span></p>
				       <input type="hidden" id="username" name="account" value="${user.username }" />
				       <input type="hidden" id="usermoney" value="${user.usermoney }" />
				       <p><input type="password" maxlength="6" name="zfpwd" id="zfpwd"></p>
				       <div class="opBtn"><a href="javascript:;" class="dialog-sure btn-go">确定</a><a href="javascript:;" class="dialog-close">关闭</a></div>
				   </section>
				</form>
				<input type="hidden" id="paypwd" value="${user.paypwd}"/>
				<script type="text/javascript">
					var oid=0;
					var realp=0
					function showCheck(orderid,realprice){
						$.ajax({
							url:"/goods/valIsSale/"+orderid,
							type:"post",
							data:"",
							dataType:"json",
							success:function(data){
								if(!data){
				            		layer.msg('对不起，该订单下商品已被下架！',{icon:2,time:1500});
				            		return;
				            	}else{
				            		var paypwd=$("#paypwd").val();
							    	if(paypwd==null || paypwd==""){
							    		closeM();
							    		layer.msg('请先设置您的支付密码! 为您跳转到安全中心',{icon:2,time:2000});
							    		setTimeout(function(){//两秒后跳转  
							                   location.href='payPassword.jsp';
							            },2000);
							    		return;
							    	}
									$('.model_bg').fadeIn(300);
							        $('.my_model').fadeIn(300);
							        oid=orderid;
							        realp=realprice;
				            	}
							},
							error:function(){
								layer.msg('ajax失败',{icon:2,time:1500});
								return;
							},
						});
					}
					
					$('.closeModel').click(function () {
				       closeM();
				    });
				    $('.dialog-close').click(function () {
				        closeM();
				    });
				    function closeM() {
				        $('.model_bg').fadeOut(300);
				        $('.my_model').fadeOut(300);
				    }
				    
				    $('.dialog-sure').click(function () {
				    	var repwd=parseFloat($("#zfpwd").val());
				    	var usermoney=$("#usermoney").val();
				    	var username=$("#username").val();
				    	if(usermoney<realp){
				    		closeM();
				    		layer.msg('对不起，您的余额不足!',{icon:2,time:1500});
				    		return;
				    	}
				    	$.ajax({
							url:"/users/checkPayPwd?username="+username+"&paypwd="+repwd,
							type:"post",
							data:"",
							dataType:"json",
							success:function(data){
								if(data){
				            		balance(oid);
				            	}else{
				            		layer.msg('支付密码不正确!',{icon:2,time:1500});
				            	}
							},
							error:function(){
								layer.msg('ajax失败',{icon:2,time:1500});
							},
						});
				    	
				    });
					
					function balance(){
			       		var userid=$("#userid").val();
						$.ajax({
							url:"/orders/balance/"+oid+"/"+userid,
							type:"post",
							data:"",
							dataType:"json",
							success:function(data){
								if(data){
									location.href='order_submit.jsp';
								}else{
									alert("订单结算异常,请稍后重试!");
								}
							},
							error:function(){
								alert("ajax创建失败！");
							},
						});
					}
				</script>
				<script type="text/javascript">
					function delOrder(orderid){
						$.ajax({
							url:"/orders/delOrder/"+orderid,
							type:"post",
							data:"",
							dataType:"json",
							success:function(data){
								if(data){
									layer.msg('该订单已删除！',{icon:1,time:1500});
									setTimeout(function(){//两秒后跳转  
				                       location.reload();
				                    },1500);
								}else{
									layer.msg('该订单删除失败',{icon:2,time:1500});
								}
							},
							error:function(){
								alert("ajax创建失败！");
							},
						});
					}
					
					function updistake(orderid){
						$.ajax({
							url:"/orders/takeover/"+orderid,
							type:"post",
							data:"",
							dataType:"json",
							success:function(data){
								if(data){
									layer.msg('恭喜您！已确认收货，欢迎下次购买',{icon:1,time:1500});
									setTimeout(function(){//两秒后跳转  
				                       location.href='/orders/getOrderByInfo/'+orderid;
				                    },1500);
								}else{
									layer.msg('数据异常,请稍后重试！',{icon:2,time:1500});
								}
							},
							error:function(){
								alert("ajax创建失败！");
							},
						});
					}
				</script>
				<!--底部-->
		<jsp:include page="common/footer.jsp"></jsp:include>
		</div>
		
	</body>

</html>